home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / eroticos / nude-streakers.swf / scripts / frame_13 / PlaceObject2_1153_217 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2005-09-23  |  2KB  |  100 lines

  1. onClipEvent(enterFrame){
  2.    if(state == "on")
  3.    {
  4.       this.swapDepths(this._y);
  5.       body.stop();
  6.       if(_root.speed < 2)
  7.       {
  8.          cop2cordx = _root.streaker._x;
  9.          cop2cordy = _root.streaker._y;
  10.       }
  11.       cx = int((- (_root.streakerx - _X)) / 3 + (- (_root.streakery - _Y)));
  12.       cy = int(- (_root.streakery - _Y) - (- (_root.streakerx - _X)) / 3);
  13.       if(Math.abs(cx) < 10 + dive_adj && Math.abs(cy) < 10 + dive_adj)
  14.       {
  15.          _root.script.streaker_fall();
  16.       }
  17.       this._x -= Math.cos(angle * 0.0174) * speed;
  18.       this._y -= Math.sin(angle * 0.0174) * speed;
  19.       chasex = Math.abs(cx) > Math.abs(cy);
  20.       chasey = !chasex;
  21.       if(chasex == true)
  22.       {
  23.          us -= 4 * (us > 0);
  24.          ds -= 4 * (ds > 0);
  25.          if(cx < 0 && ls < max_speed)
  26.          {
  27.             if(rs + us + ds == 0)
  28.             {
  29.                ls += 2;
  30.             }
  31.             temp_angle = -162;
  32.          }
  33.          else if(ls > 0)
  34.          {
  35.             ls -= 10;
  36.          }
  37.          if(cx > 0 && rs < max_speed)
  38.          {
  39.             if(ls + us + ds == 0)
  40.             {
  41.                rs += 2;
  42.             }
  43.             temp_angle = 18;
  44.          }
  45.          else if(rs > 0)
  46.          {
  47.             rs -= 10;
  48.          }
  49.       }
  50.       if(chasey == true)
  51.       {
  52.          ls -= 4 * (ls > 0);
  53.          rs -= 4 * (rs > 0);
  54.          if(cy > 0 && us < max_speed)
  55.          {
  56.             if(ls + rs + ds == 0)
  57.             {
  58.                us += 2;
  59.             }
  60.             temp_angle = 162;
  61.          }
  62.          else if(us > 0)
  63.          {
  64.             us -= 10;
  65.          }
  66.          if(cy < 0 && ds < max_speed)
  67.          {
  68.             if(ls + rs + us == 0)
  69.             {
  70.                ds += 2;
  71.             }
  72.             temp_angle = -18;
  73.          }
  74.          else if(ds > 0)
  75.          {
  76.             ds -= 10;
  77.          }
  78.       }
  79.       if(speed <= 2)
  80.       {
  81.          this.gotoAndStop((ds > 0) * 1 + (ls > 0) * 2 + (us > 0) * 3 + (rs > 0) * 4);
  82.          angle = temp_angle;
  83.          body.gotoAndStop(1);
  84.       }
  85.       if(speed > 0)
  86.       {
  87.          body.play();
  88.       }
  89.       speed = ls + rs + us + ds;
  90.       ls = Math.max(0,ls);
  91.       rs = Math.max(0,rs);
  92.       us = Math.max(0,us);
  93.       ds = Math.max(0,ds);
  94.    }
  95.    else
  96.    {
  97.       body.stop();
  98.    }
  99. }
  100.